<?php

/*
 * Copyright 2017 zhc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Indicate the column 
 *
 * @author Zhu Chen <zhuchen@greatqq.com>
 * @package Table Editor
 * @version 0.1.0
 * @abstract
 */
abstract class ColumnProperty {
    
    /**
     * The column is a integer
     */
    const COL_PROP_INT = 1;
    
    /**
     * The column is a string
     */
    const COL_PROP_STRING = 2;
    
    /**
     * The column is a time stamp
     */
    const COL_PROP_TIMESTAMP = 3;
    
    /**
     * The cloumn is a long string.
     */
    const COL_PROP_TEXT = 4;
    
    /**
     * The column store a serailized object
     */
    const COL_PROP_SERIALIZED = 5;


    /**
     * The column data Type
     * use the COL_PROP_* 
     * @var int 
     */ 
    public $type;
    
    /**
     * The field name, no space
     * @var string 
     */
    public $name;
    
    /**
     * Database column name
     * @var string 
     */
    public $dbcol;
    
    /**
     * Whether the value is read only
     * @var bool
     */
    public $readonly;
    
    /**
     * The help message 
     * @var string  
     */
    public $description;
    
    /**
     * The display name
     * @var string 
     */
    public $display;
    
    public function __construct()
    {
        
    }
    
    public abstract function GetSQLString($object);
    public abstract function GetDisplayString($dbstr);
    
    
}
